<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>骨医快线</title>
	<link href="../../css/mui.plus.css" rel="stylesheet" />	
	<style>
		.pat-title {
			position: relative;
			padding: 15px 11px;
			color: #30B497;
		}
		.pat-title:after {
			position: absolute;
		    left: 0;
		    right: 0;
		    bottom: 0;
		    height: 1px;
		    background-color: #c8c7cc;
		    content: '';
		    -webkit-transform: scaleY(0.5);
		    transform: scaleY(0.5);
		}
		.pat-btn-group {
			margin: auto 10%;	
			margin-top: 10px;
		}
		.mui-btn-block {
			padding: 8px 0;
		}
		footer {
			position: absolute;
			bottom: 0;left: 0;right: 0;
		}
		footer .mui-btn-block {
			margin-bottom: 30px;
		}
	</style>
</head>
<body>
	<header class="mui-bar mui-bar-nav oe-pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">骨研社</h1>
	</header>
	
	<footer>
		<div class="pat-btn-group">
			<button id="btn-logout" type="button" class="mui-btn mui-btn-grey mui-btn-block">退出当前账号</button>
		</div>
		<div style="padding-right: 15px;">
			<p style="text-align: center;">PC端有更多实用功能<br />欢迎访问www.orthexpress.com</p>
		</div>
	</footer>
	
	<div class="mui-content">
		<div class="pat-title">
			所有项目
		</div>
			
		<div id="list-bone" class="pat-btn-group">
			<button type="button" class="mui-btn mui-btn-primary mui-btn-block">老年髋部骨折项目</button>
		</div>
		
		
	</div>
	
	<script id="tmp-bone" type="text/html">
		{{each data as v i}}
			<button type="button" class="mui-btn mui-btn-primary mui-btn-block" data-page="{{v.re_prj_uri}}/home.html">{{v.re_prj_name}}</button>
		{{/each}}
	</script>
	
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/lib/template.js"></script>
	<script>
		(function($, a){
			var wv,
				html,
				tmpData,
				listBone = document.getElementById("list-bone");
			
			$('.mui-content').on('tap', 'button', function(){
				$.openWindow({
					url: this.dataset.page,
					waiting: {
						autoShow: false
					},
					extras: {
						data : wv.data
					}
				});
			})
			
			$('footer').on('tap', '#btn-logout', function(){
				app.storage.removeGysUserInfo();
				$.back();
			})
			
			$.plusReady(function(){
				wv = plus.webview.currentWebview();
				
				getBoneList(wv.data.actor_id)
			});
			
			var getBoneList = function(actor_id){
				a.net.get('c_bone_research_prj/show_my_list', {actor_id: actor_id}, function(data){
					if(data && data.code === '100'){
						tmpData = data;
						html = template('tmp-bone', tmpData);
						listBone.innerHTML = html;
					}
				});
			}
			
		}(mui, app));
	</script>
</body>
</html>